var xmlHttp
var p_id
var update_location

function updateUser(user_id, u_row, u_num, script_location)
{ 
	
	u_id = user_id;

	u_level = document.getElementById('level' + u_id).value;
	u_name = document.getElementById('name' + u_id).value;
	u_username = document.getElementById('username' + u_id).value;
	u_password1 = document.getElementById('password1' + u_id).value;
	u_password2 = document.getElementById('password2' + u_id).value;
	u_email = document.getElementById('email' + u_id).value;
	
	update_location = script_location
	

	var url="admin.php?action=uu&u_id=" + u_id + "&u_name=" + u_name + "&u_username=" + u_username + "&u_password1=" + u_password1 + "&u_password2=" + u_password2 + "&u_level=" + u_level + "&u_row=" + u_row + "&p_num=" + u_num + "&u_email=" + u_email + "&location=" + script_location

	xmlHttp=GetXmlHttpObject(stateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		if (update_location == 1) 
		{
			document.getElementById('user' + u_id).innerHTML = xmlHttp.responseText;	
		} else 
		{
			document.getElementById('panel' + p_id).innerHTML = xmlHttp.responseText;	
		}
		
	} 
} 

function GetXmlHttpObject(handler)
{ 
	var objXmlHttp=null

	if (navigator.userAgent.indexOf("MSIE")>=0)
	{ 
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
	{
		strName="Microsoft.XMLHTTP"
	} 
	try
	{ 
		objXmlHttp=new ActiveXObject(strName)
		objXmlHttp.onreadystatechange=handler 
		return objXmlHttp
	} 
	catch(e)
	{ 
		alert("Error. Scripting for ActiveX might be disabled") 
		return 
	} 
	} 
		if (navigator.userAgent.indexOf("Mozilla")>=0 || navigator.userAgent.indexOf("Opera")>=0)
	{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler 
		return objXmlHttp
	}
} 
